package com.ruoyi.retirement.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.retirement.domain.RetirementArticle;
import com.ruoyi.retirement.mapper.RetirementArticleReviewMapper;
import com.ruoyi.retirement.service.IRetirementArticleReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章审核Service业务层处理
 * 
 * @author 曹旭
 * @date 2025-09-02
 */
@Service
public class RetirementArticleReviewServiceImpl implements IRetirementArticleReviewService 
{
    @Autowired
    private RetirementArticleReviewMapper retirementArticleReviewMapper;


    /**
     * 查询文章审核列表
     * 
     * @param retirementArticleReview 文章审核
     * @return 文章审核
     */
    @Override
    public List<RetirementArticle> selectRetirementArticleReviewList(RetirementArticle retirementArticleReview)
    {
        return retirementArticleReviewMapper.selectRetirementArticleReviewList(retirementArticleReview);
    }

    @Override
    public int articleReview(RetirementArticle retirementArticle) {
        if ("3".equals(retirementArticle.getStatus())) {
            retirementArticle.setReason(" ");
            retirementArticle.setDate(DateUtils.getTime());
        }
        return retirementArticleReviewMapper.articleReview(retirementArticle);
    }

    @Override
    public int stickToTop(RetirementArticle retirementArticle) {
        return retirementArticleReviewMapper.stickToTop(retirementArticle);
    }

    @Override
    public int unpublish(RetirementArticle retirementArticle) {
        return retirementArticleReviewMapper.unpublish(retirementArticle);
    }

}
